1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gtk.AccessibleT;
26 
27 public  import gobject.Value;
28 public  import gtk.c.functions;
29 public  import gtk.c.types;
30 
31 
32 /**
33  * `GtkAccessible` is an interface for describing UI elements for
34  * Assistive Technologies.
35  * 
36  * Every accessible implementation has:
37  * 
38  * - a “role”, represented by a value of the [enum@Gtk.AccessibleRole] enumeration
39  * - an “attribute”, represented by a set of [enum@Gtk.AccessibleState],
40  * [enum@Gtk.AccessibleProperty] and [enum@Gtk.AccessibleRelation] values
41  * 
42  * The role cannot be changed after instantiating a `GtkAccessible`
43  * implementation.
44  * 
45  * The attributes are updated every time a UI element's state changes in
46  * a way that should be reflected by assistive technologies. For instance,
47  * if a `GtkWidget` visibility changes, the %GTK_ACCESSIBLE_STATE_HIDDEN
48  * state will also change to reflect the [property@Gtk.Widget:visible] property.
49  */
50 public template AccessibleT(TStruct)
51 {
52 	/** Get the main Gtk struct */
53 	public GtkAccessible* getAccessibleStruct(bool transferOwnership = false)
54 	{
55 		if (transferOwnership)
56 			ownedRef = false;
57 		return cast(GtkAccessible*)getStruct();
58 	}
59 
60 
61 	/**
62 	 * Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`.
63 	 *
64 	 * Returns: a `GtkAccessibleRole`
65 	 */
66 	public GtkAccessibleRole getAccessibleRole()
67 	{
68 		return gtk_accessible_get_accessible_role(getAccessibleStruct());
69 	}
70 
71 	/**
72 	 * Resets the accessible @property to its default value.
73 	 *
74 	 * Params:
75 	 *     property = a `GtkAccessibleProperty`
76 	 */
77 	public void resetProperty(GtkAccessibleProperty property)
78 	{
79 		gtk_accessible_reset_property(getAccessibleStruct(), property);
80 	}
81 
82 	/**
83 	 * Resets the accessible @relation to its default value.
84 	 *
85 	 * Params:
86 	 *     relation = a `GtkAccessibleRelation`
87 	 */
88 	public void resetRelation(GtkAccessibleRelation relation)
89 	{
90 		gtk_accessible_reset_relation(getAccessibleStruct(), relation);
91 	}
92 
93 	/**
94 	 * Resets the accessible @state to its default value.
95 	 *
96 	 * Params:
97 	 *     state = a `GtkAccessibleState`
98 	 */
99 	public void resetState(GtkAccessibleState state)
100 	{
101 		gtk_accessible_reset_state(getAccessibleStruct(), state);
102 	}
103 
104 	/**
105 	 * Updates an array of accessible properties.
106 	 *
107 	 * This function should be called by `GtkWidget` types whenever an accessible
108 	 * property change must be communicated to assistive technologies.
109 	 *
110 	 * This function is meant to be used by language bindings.
111 	 *
112 	 * Params:
113 	 *     properties = an array of `GtkAccessibleProperty`
114 	 *     values = an array of `GValues`, one for each property
115 	 */
116 	public void updatePropertyValue(GtkAccessibleProperty[] properties, Value[] values)
117 	{
118 		GValue[] valuesArray = new GValue[values.length];
119 		for ( int i = 0; i < values.length; i++ )
120 		{
121 			valuesArray[i] = *(values[i].getValueStruct());
122 		}
123 
124 		gtk_accessible_update_property_value(getAccessibleStruct(), cast(int)values.length, properties.ptr, valuesArray.ptr);
125 	}
126 
127 	/**
128 	 * Updates an array of accessible relations.
129 	 *
130 	 * This function should be called by `GtkWidget` types whenever an accessible
131 	 * relation change must be communicated to assistive technologies.
132 	 *
133 	 * This function is meant to be used by language bindings.
134 	 *
135 	 * Params:
136 	 *     relations = an array of `GtkAccessibleRelation`
137 	 *     values = an array of `GValues`, one for each relation
138 	 */
139 	public void updateRelationValue(GtkAccessibleRelation[] relations, Value[] values)
140 	{
141 		GValue[] valuesArray = new GValue[values.length];
142 		for ( int i = 0; i < values.length; i++ )
143 		{
144 			valuesArray[i] = *(values[i].getValueStruct());
145 		}
146 
147 		gtk_accessible_update_relation_value(getAccessibleStruct(), cast(int)values.length, relations.ptr, valuesArray.ptr);
148 	}
149 
150 	/**
151 	 * Updates an array of accessible states.
152 	 *
153 	 * This function should be called by `GtkWidget` types whenever an accessible
154 	 * state change must be communicated to assistive technologies.
155 	 *
156 	 * This function is meant to be used by language bindings.
157 	 *
158 	 * Params:
159 	 *     states = an array of `GtkAccessibleState`
160 	 *     values = an array of `GValues`, one for each state
161 	 */
162 	public void updateStateValue(GtkAccessibleState[] states, Value[] values)
163 	{
164 		GValue[] valuesArray = new GValue[values.length];
165 		for ( int i = 0; i < values.length; i++ )
166 		{
167 			valuesArray[i] = *(values[i].getValueStruct());
168 		}
169 
170 		gtk_accessible_update_state_value(getAccessibleStruct(), cast(int)values.length, states.ptr, valuesArray.ptr);
171 	}
172 }